package com.zbkj.service.community.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.zbkj.common.model.community.CommunityOrder;
import com.zbkj.common.request.CommunityOrderSearchRequest;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.service.community.CommunityOrderService;
import com.zbkj.service.dao.community.CommunityOrderDao;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author keNan
* @description CommunityOrderServiceImpl 接口实现
* @date 2025-06-26
*/
@Service
public class CommunityOrderServiceImpl extends ServiceImpl<CommunityOrderDao, CommunityOrder> implements CommunityOrderService {

    @Resource
    private CommunityOrderDao dao;


    /**
    * 列表
    * @param request 请求参数
    * @param pageParamRequest 分页类参数
    * @author keNan
    * @since 2025-06-26
    * @return List<CommunityOrder>
    */
    @Override
    public List<CommunityOrder> getList(CommunityOrderSearchRequest request, PageParamRequest pageParamRequest) {
        PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());

        //带 CommunityOrder 类的多条件查询
        LambdaQueryWrapper<CommunityOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        CommunityOrder model = new CommunityOrder();
        BeanUtils.copyProperties(request, model);
        lambdaQueryWrapper.setEntity(model);
        return dao.selectList(lambdaQueryWrapper);
    }

}

